'''
Data model.

@author: Tatiana Kichkaylo
'''

from google.appengine.ext import db

class AssetType(db.Model):
  """Taxonomy of asset types"""
  name = db.StringProperty()
  # name of the parent asset type. may be None
  parentType = db.StringProperty(default=None)
  # minimum allowed number of assets of this type, >=0
  minCount = db.IntegerProperty(default=0)
  # maximum allowed number of assets of this type, -1 means unrestricted
  maxCount = db.IntegerProperty(default=-1)
  # sorting order in the list
  sortOrder = db.IntegerProperty()

class AssetInstance(db.Model):
  """Something a user has"""
  user = db.UserProperty()
  assetType = db.StringProperty()
  name = db.StringProperty()
  
class DocumentType(db.Model):
  """Taxonomy of document types"""
  name = db.StringProperty()
  
class DocumentPlace(db.Model):
  """Placeholder for document instances"""
  # Need some unique identifier, or... rule + list of assetInstances
  name = db.StringProperty()
  user = db.UserProperty()
  documentType = db.StringProperty()
  # Remember the asset instances that caused this thing to be created?
